# Contributor: Gennady Feldman <gena01@gmail.com>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=envconsul
pkgver=0.9.3
pkgrel=1
pkgdesc="Read and set environmental variables for processes from Consul."
url="https://www.consul.io/"
arch="all"
license="MPL-2.0"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/hashicorp/envconsul/archive/v$pkgver.tar.gz"

build() {
	export CGO_ENABLED="0"
	mkdir -p pkg/linux-$CARCH
	go build -v -o pkg/linux-$CARCH/$pkgname
}

check() {
	go test -timeout=30s -parallel=20 -failfast
}

package() {
	# Main binary
	install -m755 -D pkg/linux-$CARCH/$pkgname "$pkgdir"/usr/bin/$pkgname
}

sha512sums="7bf2503b3545fd5d0771b2ed637bf35855327b173c7968a19d896c87f5fe6a47049bc07d37a9a86d762103d9fbf41dd0ee220d23077a068195d9ddb0565566b7  envconsul-0.9.3.tar.gz"
